import Vue from 'vue'
import VueRouter from 'vue-router'

import Login from '../components/Login.vue'
import Register from '../components/Register.vue'
import Books from '../components/Books.vue'
import AddBook from '../components/AddBook.vue'

Vue.use(VueRouter)

export default new VueRouter({
    routes:[
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: '/login',
            component: Login
        },
        {
            path: '/register',
            component: Register
        },
        {
            path: '/books',
            component: Books
        },
        {
            path: '/addBook/:date',
            name: 'addBook',
            component: AddBook
        }
    ]
})
